<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <h1>hello html</h1>
    <div class="box"></div>
<!--    <p>test1: <span class="text1"></span></p>-->
    <p>test2: <span class="text2"></span></p>
    <button class="btn">按钮</button>
    <script>
        // document.querySelector('.text1').innerText = window.data.count;

        function render() {
            document.querySelector('.text2').innerText = window.data.getCount();
        }
        render();

        document.querySelector('.btn').onclick = function () {
            window.data.setCount();
            render();
        }
    </script>
</body>
</html>